package easy;

import java.util.HashSet;
import java.util.Set;

public class Solution_1704 {
    public boolean halvesAreAlike(String s) {
        char[] array = new char[]{'a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U'};
        Set<Character> set = new HashSet<>();
        for (char c : array) {
            set.add(c);
        }
        char[] chars = s.toCharArray();
        int len = chars.length >> 1, a = 0, b = 0;
        for (int i = 0, j = len; i < len; i++, j++) {
            if (set.contains(chars[i])) {
                a++;
            }
            if (set.contains(chars[j])) {
                b++;
            }
        }
        return a == b;
    }

    public static void main(String[] args) {
        Solution_1704 model = new Solution_1704();
    }
}
